package cmpe451.group7.ourcity.util;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.regex.Pattern;

public class GlobalVariables {

	// Required request parameters for the servlets

	public static final List<String> addCommentRequiredParameters = new ArrayList<String>();
	static {
		addCommentRequiredParameters.add("placeID");
		addCommentRequiredParameters.add("userID");
		addCommentRequiredParameters.add("password");
		addCommentRequiredParameters.add("comment");

	}

	public static final List<String> getPlaceCommentRequiredParameters = new ArrayList<String>();
	static {
		getPlaceCommentRequiredParameters.add("placeID");

	}

	public static final List<String> getUserCommentRequiredParameters = new ArrayList<String>();
	static {
		getUserCommentRequiredParameters.add("userID");

	}

	public static final List<String> getUserLikedPlacesRequiredParameters = new ArrayList<String>();
	static {
		getUserLikedPlacesRequiredParameters.add("userID");

	}

	public static final List<String> likePageRequiredParameters = new ArrayList<String>();
	static {
		likePageRequiredParameters.add("placeID");
		likePageRequiredParameters.add("userID");
		likePageRequiredParameters.add("password");
	}

	public static List<String> getBadgesRequiredParameters = new ArrayList<String>();
	static {
		getBadgesRequiredParameters.add("userID");
	}

	// Global strings

	public static final String _123456_to_AES = "BFBA482351853CD0C8BEA4E89988FBCB";

	// Properties written in the ".properties" file
	// Read once, use multiple times

	public static final Properties properties = new Properties();
	static {
		try {
			properties.load(GlobalVariables.class.getClassLoader()
					.getResourceAsStream("app.properties"));
			properties.load(GlobalVariables.class.getClassLoader()
					.getResourceAsStream("google.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static final Pattern audioURLPattern = Pattern
			.compile("^(http[s]?://vocaroo.com/i/[^=?&]*)$");
	public static final Pattern audioIdPattern = Pattern
			.compile("i/([^=?& ]*)");
}
